using System;
using EPiServer.Common;
using EPiServer.Common.Publishing;
using EPiServer.Common.Security;
using EPiServer.Community.ImageGallery;
using EPiServer.Community.MyPage;
using EPiServer.Community.MyPage.Queries;
using EPiServer.Community.Poll;

namespace EPiAbstractions.Community.MyPage
{
    public interface IMyPageHandlerFacade
    {
        Boolean IsBlocked(EPiServer.Community.MyPage.MyPage mp, IUser blockee);

        UserCollection GetBlockedUsers(EPiServer.Community.MyPage.MyPage mp, Int32 page, Int32 pageSize);

        UserCollection GetBlockedUsers(EPiServer.Community.MyPage.MyPage mp, Int32 page, Int32 pageSize, out Int32 totalItems);

        void AddBlock(EPiServer.Community.MyPage.MyPage mp, IUser blockee);

        void RemoveBlock(EPiServer.Community.MyPage.MyPage mp, IUser blockee);

        void UpdateMyPage(EPiServer.Community.MyPage.MyPage mp);

        void AddVisit(EPiServer.Community.MyPage.MyPage mp, IUser visitor);

        VisitCollection GetLatestVisitors(EPiServer.Community.MyPage.MyPage mp, Int32 maxVisitors);

        EPiServer.Community.MyPage.MyPage GetMyPage(IUser user);

        EPiServer.Community.MyPage.MyPage GetMyPage(IUser user, ISite site);

        EPiServer.Community.MyPage.MyPage GetMyPage(IUser user, ISite site, Boolean createMyPage);

        EPiServer.Community.MyPage.MyPage GetMyPage(Int32 id);

        PollCollection GetMyPagePolls(EPiServer.Community.MyPage.MyPage mp, Int32 page, Int32 pageSize, PollSortOrder[] order);

        PollCollection GetMyPagePolls(EPiServer.Community.MyPage.MyPage mp, Int32 page, Int32 pageSize, out Int32 totalItems,
                                      PollSortOrder[] order);

        Poll AddMyPagePoll(EPiServer.Community.MyPage.MyPage mp, Poll poll);

        void RemoveMyPagePoll(EPiServer.Community.MyPage.MyPage mp, Poll poll);

        ImageCollection GetPortraitImages(Int32 page, Int32 pageSize, PublishState publishState, ImageSortOrder[] sortOrder);

        ImageCollection GetPortraitImages(Int32 page, Int32 pageSize, PublishState publishState, out Int32 totalImages,
                                          ImageSortOrder[] sortOrder);

        event EPiServerCommonEventHandler Register;

        event EPiServerCommonEventHandler UserRemoved;

        event EPiServerCommonEventHandler Visit;

        event EPiServerCommonEventHandler BlockAdded;

        event EPiServerCommonEventHandler BlockRemoved;

        MyPageCollection GetQueryResult(MyPageQuery query);

        MyPageCollection GetQueryResult(MyPageQuery query, Int32 page, Int32 pageSize);

        MyPageCollection GetQueryResult(MyPageQuery query, Int32 page, Int32 pageSize, out Int32 totalItems);

        VisitCollection GetQueryResult(VisitQuery query);

        VisitCollection GetQueryResult(VisitQuery query, Int32 page, Int32 pageSize);

        VisitCollection GetQueryResult(VisitQuery query, Int32 page, Int32 pageSize, out Int32 totalItems);
    }
}